package com.spddr.pmos.jpa;

import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import cn.seqdata.jpa.JpaNoGeneratedObject;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@MappedSuperclass
public class PowerSystemResource extends JpaNoGeneratedObject {
	private static final long serialVersionUID = 1L;

	private UsagePoint usagePoint;

	public PowerSystemResource() {
		super();
	}

	public PowerSystemResource(Long id) {
		super(id);
	}

	public PowerSystemResource(Long id, String name) {
		super(id, name);
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "usage_point")
	@JsonSerialize(using = cn.seqdata.jackson.ObjectSerializer.IdName.class)
	public UsagePoint getUsagePoint() {
		return this.usagePoint;
	}

	public void setUsagePoint(UsagePoint usagePoint) {
		this.usagePoint = usagePoint;
	}
}
